window.onload=function(){
	
	// 
	var choice={
		template:"#choice",
		data(){
			return{
				list:["精选","精选微课","计算机","国家精品"],
				color:0,
				picture:[{img:"img/lb1.jpg"},
					{img:"img/lb2.png"},
					{img:"img/lb3.png"},
					{img:"img/lb4.png"},
					{img:"img/lb5.jpg"},
					{img:"img/lb6.png"}],
				sub:[
					{src:"img/c1.png",text:"国家精品"},
					{src:"img/c2.png",text:"计算机"},
					{src:"img/c3.png",text:"经济管理"},
					{src:"img/c4.png",text:"心理学"},
					{src:"img/c5.png",text:"全部课程"},
					{src:"img/c6.png",text:"22/23考研"},
					{src:"img/c7.png",text:"四六级英语"},
					{src:"img/c8.png",text:"期末不挂"},
					{src:"img/c9.png",text:"考证就业"},
					{src:"img/c10.png",text:"限时公开课"}
					],
				zb_content:[
					{
						time:"2021.06.29 18:00-19:00",
						img:"img/czk.png",
						title:"四六级题型技巧串讲（6月29日）",
						teacher:"陈正康老师"
					},{
						time:"2021.06.29 19:30-20:00",
						img:"img/wzx.png",
						title:"武忠祥教授高数答疑6月专场",
						teacher:"武忠祥教授"
					},{
						time:"2021.06.29 19:00-20:30",
						img:"img/wym.png",
						title:"高分必备：考研政治高分攻略",
						teacher:"王一珉老师"
					}],
				open:[
					{
						title:"零基础轻松学python",
						img:"img/python.jpg",
						people:"1046"
					},{
						title:"4小时学完C语言",
						img:"img/cL.png",
						people:"582"
					},{
						title:"数据结构",
						img:"img/sjjg.jpg"
					},{
						title:"计算机二级",
						img:"img/open1.png"
					}
				],
				weekcourse:[
					{
						img:"img/week1.png",
						title:"猴博士期末课堂",
						teacher:"考拉学姐"
					},{
						img:"img/week2.png",
						title:"从0到20000+词汇速记营",
						teacher:"陈正康"
					},{
						img:"img/week3.png",
						title:"22考研计算机直播课",
						teacher:"王道论坛"
					},{
						img:"img/week4.png",
						title:"4小时学完概率论与数理统计",
						teacher:"猴博士"
					},{
						img:"img/open2.jpg",
						title:"程序设计入门——C语言",
						teacher:"浙江大学"
					}],
					color:["one","two","three"]
			}
		}
		
	}
	var select={
		template:"#select",
		data(){
			return{
				hobby_list:[{
					picture:"img/h1.jpg",
					title:"最强大脑·3天挑战极限记忆力",
					time:"2021-07-02 20:00",
					teachear:"卢菲菲",
					people:"2417",
					flag:{
						show:true,
						text:"打折"
					}
					
				},{
					picture:"img/h1.jpg",
					title:"商业插画变现小白营",
					time:"2021-07-02 20:00",
					teachear:"戳戳",
					people:"272",
					flag:{
						show:true,
						text:"实用技能"
					}
					
				},{
					picture:"img/h1.jpg",
					title:"3天播音配音训练营",
					time:"2021-07-02 20:00",
					teachear:"奶昔",
					people:"218",
					flag:{
						show:true,
						text:"实用技能"
					}
					
				}],
				english_list:[{
					picture:"img/h1.jpg",
					title:"'看漫画'速拓英文1000词",
					time:"2021-07-01 20:00",
					teachear:"祁连山",
					people:"140",
					flag:{
						show:true,
						text:"实用英语"
					}
				},{
					picture:"img/h1.jpg",
					title:"5天英文经典阅读",
					time:"2021-07-03 20:00",
					teachear:"杨亮",
					people:"222",
					flag:{
						show:true,
						text:"实用英语"
					}
				},{
					picture:"img/h1.jpg",
					title:"3天公式巧学英语",
					time:"2021-07-05 20:00",
					teachear:"赵茜茜",
					people:"1407",
					flag:{
						show:true,
						text:"逻辑英语"
					}
				},{
					picture:"img/h1.jpg",
					title:"800词玩转流利口语",
					time:"2021-07-05 20:00",
					teachear:"爱丽丝",
					people:"70",
					flag:{
						show:true,
						text:"实用英语"
					}
				}]
			}
		}
	}
	var computer={
		template:"#computer",
		data(){
			
		}
	}
	
	var quality={
		template:"#quality",
		data(){
			return{
				q_Course:[
						{img:"img/tuijian01.webp",title:"天文漫谈",school:"华中科技大学",txt:"5946人参加"},
						{img:"img/tuijian02.webp",title:"高等数学先修课",school:"西南财经大学",txt:"8750人参加"},
						{img:"img/tuijian03.webp",title:"术与人类文明",school:"广西大学",txt:"897人参加"},
						{img:"img/tuijian04.webp",title:"世界华文文学经典欣赏",school:"武汉大学",txt:"7478人参加"}
					],
					q_course2:[{img:"img/all01.webp",name:"生物医药实验安全知识",school:"暨南大学",icon:"images/icon_end01.png",tip:"已结束",renshu:"3734人参加"},
					{img:"img/all02.webp",name:"巧克毕业论文",school:"南昌大学",icon:"images/icon_kaike.png",tip:"2021-07-05开课",renshu:"1326人参加"},
					{img:"img/all03.webp",name:"教师如何做研究",school:"北京大学",icon:"images/icon_kaike.png",tip:"2021-07-04开课",renshu:"5930人参加"},
					{img:"img/all04.webp",name:"班主任的沟通艺术",school:"爱课程",icon:"images/icon_end.png",tip:"进行至第2周",renshu:"1413人参加"},
					{img:"img/all06.webp",name:"沟通心理学",school:"哈尔滨工业大学",icon:"images/icon_end.png",tip:"进行至第14周",renshu:"87943人参加"},
					{img:"img/all05.webp",name:"程序设计与算法(二) 算法基础",school:"北京大学",icon:"images/icon_end.png",tip:"进行至第5周",renshu:"2061人参加"},
					{img:"img/all07.webp",name:"大学英语自学课程(上)",school:"北京科技大学",icon:"images/icon_kaike.png",tip:"2021-07-10开课",renshu:"6465人参加"},
					{img:"img/all08.webp",name:"互联网金融",school:"中央财经大学",icon:"images/icon_end.png",tip:"进行至第3周",renshu:"6128人参加"}]
				
			}
		}
	}
	var router1 = new VueRouter({
		routes:[{
			path:"/choice",
			component:choice},
			{
			path:"/select",
			component:select
			},{
			path:"/computer",
			component:computer
			},{
			path:"/quality",
			component:quality
			},{
			path:"/*",
			redirect:"/choice"
			}]
	})
	var index = {
		template:"#index",
		
		methods:{
			change(index){
				this.color=index;
			}
		},
		mounted(){
			var banner=document.getElementById("banner");
			var open_list=document.getElementById("open_list");
			// var left=document.getElementById("left");
			// var right=document.getElementById("right");
			var i=0,j=0;
			var timer=setInterval(function(){
				i++;
				if(i==6){
					i=0;
				}
				banner.style.marginLeft=-345*i+"px";
			},1500)
			
			var timer2=setInterval(function(){
				j++;
				if(j==2){
					j=0;
				}
				open_list.style.marginLeft=-344*j+"px";
			},1500)
			
			
		},
		router:router1
	}
	

	
	// 学习
	var lump01 = {
		template:"#lump01",
	}
	var lump02 = {
		template:"#lump02",
		data(){
			return{
				num:0,
				classname:"card_2"
			}
		},
		methods: {
		    change(){
				this.num++;
				this.classname = "card_2_change"
			}
		}
	}
	var lump03 = {
		template:"#lump03",
		data(){
			return{
				max: 4,
				showMore: false,
				course:[{img:"img/course01.jpg",name:"web系统设计",school:"广西科技大学启迪数字学院",time:"已学59/59课时"},
				{img:"img/course02.jpg",name:"信息安全导论",school:"广西科技大学启迪数字学院",time:"已学36/36课时"},
				{img:"img/course03.jpg",name:"移动应用开发技术",school:"广西科技大学启迪数字学院",time:"已学33/41课时"},
				{img:"img/course04.jpg",name:"web开发基础",school:"广西科技大学启迪数字学院",time:"已学51/63课时"},
				
				{img:"img/course05.jpg",name:"汇编语言程序设计",school:"广西科技大学启迪数字学院",time:"已学27/31课时"},
				{img:"img/course06.jpg",name:"软件体系结构",school:"广西科技大学启迪数字学院",time:"已学9/10课时"},
				{img:"img/course07.jpeg",name:"创新与创业管理",school:"广西科技大学启迪数字学院",time:"已学24/27课时"},
				{img:"img/course08.jpg",name:"信息搜索与分析",school:"广西科技大学启迪数字学院",time:"已学50/50课时"},
				{img:"img/course09.jpg",name:"算法设计与分析",school:"广西科技大学启迪数字学院",time:"已学77/81课时"},
				{img:"img/course10.png",name:"Python及其应用",school:"广西科技大学启迪数字学院",time:"已学86/105课时"}]
			}
		}
	}
	var study = {
		template:"#study",
		// data(){
			
		// },
		//绑定组件
		components:{
			//占位符：定义的组件
			"v-lump01":lump01,
			"v-lump02":lump02,
			"v-lump03":lump03
		}
	}
	
	// 账号
	var vhead = {
		template:"#head",
		data(){
			return{
				nav01:[{src:"img/set.png"},{src:"img/msg.png"}],
				
				nav02:[{item1:"62",item2:"讨论"},{item1:"0",item2:"关注"},{item1:"0",item2:"证书"}],
				
			}	
			
		},
		methods:{
			link(i){
				if(i==0){
					 window.open("set.html","_self");
				}else{
					window.open("msg.html","_self");
				}
					
			}
		}
		
	}
		
	var vfoot = {
		template:"#foot",
		data(){
			return{
				nav03:[
				{src:"img/yun.png",text301:"我的学校云",text302:">"},
				{src:"img/kan.png",text301:"我的砍价",text302:">"},
				{src:"img/ms.png",text301:"我的团购",text302:">"},
				{src:"img/sum.png",text301:"我的推广",text302:">"},
				{src:"img/quan.png",text301:"我的优惠券",text302:">"},
				{src:"img/share.png",text301:"分享APP",text302:">"},
				{src:"img/ping.png",text301:"去评分",text302:">"}
				],
			}
		}
	}
	
	var my = {
		template:"#my",
		
		components:{
			"v-head":vhead,
			// "v-main":vmain,
			"v-foot":vfoot
		}
	}
	
	
	
	
	
//			配置路由
	var router =new VueRouter({
		routes:[{
			path:"/index",
			component:index,

		},{
			path:"/study",
			component:study
		},{
			path:"/my",
			component:my
		},{
			path:"/*",
//					重定向:当其他路径不满足时,执行此路径 , 重新指定路径
			redirect:"/index"
		}]
	})
	new Vue({
		el:"#box",
		data:{
			// src:["img/cute01.jpg","img/cute01.jpg","收藏夹"]
		},
//				挂载路由
		
		router:router
	})
}